home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / ds5000.md / RCS / a.out.h,v < prev    next >
Encoding:
Text File  |  1989-11-12  |  11.0 KB  |  421 lines

  1. head     1.4;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.4
  10. date     89.11.12.01.31.42;  author rab;  state Exp;
  11. branches ;
  12. next     1.3;
  13.  
  14. 1.3
  15. date     89.10.12.16.03.56;  author douglis;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     89.08.01.15.15.42;  author douglis;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     89.08.01.15.15.16;  author douglis;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @initial version (sprite-based??)
  32. @
  33.  
  34.  
  35. 1.4
  36. log
  37. @Added `ds3100.md' to machine dependent includes.
  38. @
  39. text
  40. @/*     @@(#)a.out.h    4.2    (ULTRIX)    7/13/88                    */
  41. /************************************************************************
  42.  *                                    *
  43.  *            Copyright (c) 1986,1988 by            *
  44.  *        Digital Equipment Corporation, Maynard, MA        *
  45.  *            All rights reserved.                *
  46.  *                                    *
  47.  *   This software is furnished under a license and may be used and    *
  48.  *   copied  only  in accordance with the terms of such license and    *
  49.  *   with the  inclusion  of  the  above  copyright  notice.   This    *
  50.  *   software  or  any  other copies thereof may not be provided or    *
  51.  *   otherwise made available to any other person.  No title to and    *
  52.  *   ownership of the software is hereby transferred.            *
  53.  *                                    *
  54.  *   This software is  derived  from  software  received  from  the    *
  55.  *   University    of   California,   Berkeley,   and   from   Bell    *
  56.  *   Laboratories.  Use, duplication, or disclosure is  subject  to    *
  57.  *   restrictions  under  license  agreements  with  University  of    *
  58.  *   California and with AT&T.                        *
  59.  *                                    *
  60.  *   The information in this software is subject to change  without    *
  61.  *   notice  and should not be construed as a commitment by Digital    *
  62.  *   Equipment Corporation.                        *
  63.  *                                    *
  64.  *   Digital assumes no responsibility for the use  or  reliability    *
  65.  *   of its software on equipment which is not supplied by Digital.    *
  66.  *                                    *
  67.  ************************************************************************/
  68. /*
  69.  *
  70.  *   Modification History:
  71.  *
  72.  * 02 Apr 86 -- depp
  73.  *    Moved struct exec and associated magic numbers to <sys/exec.h>
  74.  *
  75.  */
  76. /*    a.out.h    4.1    83/05/03    */
  77.  
  78. #ifndef _AOUT
  79. #define _AOUT
  80.  
  81. #include <ds3100.md/nlist.h>
  82. #include <ds3100.md/sys/exec.h>
  83.  
  84. /*
  85.  * See syms.h for "mips" symbol table
  86.  */
  87.  
  88.  
  89.  /*        COMMON OBJECT FILE FORMAT
  90.  
  91.     File Organization:
  92.  
  93.     _______________________________________________    INCLUDE FILE
  94.     |_______________HEADER_DATA___________________|
  95.     |                          |
  96.     |    File Header                  |    "filehdr.h"
  97.     |.............................................|
  98.     |                          |
  99.     |    Auxilliary Header Information          |       "aouthdr.h"
  100.     |                          |
  101.     |_____________________________________________|
  102.     |                          |
  103.     |    ".text" section header              |       "scnhdr.h"
  104.     |                          |
  105.     |.............................................|
  106.     |                          |
  107.     |    ".data" section header              |          ''
  108.     |                          |
  109.     |.............................................|
  110.     |                          |
  111.     |    ".bss" section header              |          ''
  112.     |                          |
  113.     |_____________________________________________|
  114.     |______________RAW_DATA_______________________|
  115.     |                          |
  116.     |    ".text" section data (rounded to 4    |
  117.     |                bytes)          |
  118.     |.............................................|
  119.     |                          |
  120.     |    ".data" section data (rounded to 4    |
  121.     |                bytes)          |
  122.     |_____________________________________________|
  123.     |____________RELOCATION_DATA__________________|
  124.     |                          |
  125.     |    ".text" section relocation data          |    "reloc.h"
  126.     |                          |
  127.     |.............................................|
  128.     |                          |
  129.     |    ".data" section relocation data          |       ''
  130.     |                          |
  131.     |_____________________________________________|
  132.     |__________LINE_NUMBER_DATA_(SDB)_____________|
  133.     |                          |
  134.     |    ".text" section line numbers          |    "linenum.h"
  135.     |                          |
  136.     |.............................................|
  137.     |                          |
  138.     |    ".data" section line numbers          |          ''
  139.     |                          |
  140.     |_____________________________________________|
  141.     |________________SYMBOL_TABLE_________________|
  142.     |                          |
  143.     |    ".text", ".data" and ".bss" section   |    "syms.h"
  144.     |    symbols                      |       "storclass.h"
  145.     |                          |
  146.     |_____________________________________________|
  147.     |________________STRING_TABLE_________________|
  148.     |                          |
  149.     |        long symbol names              |
  150.     |_____________________________________________|
  151.  
  152.  
  153.  
  154.         OBJECT FILE COMPONENTS
  155.  
  156.     HEADER FILES:
  157.             /usr/include/filehdr.h
  158.             /usr/include/aouthdr.h
  159.             /usr/include/scnhdr.h
  160.             /usr/include/reloc.h
  161.             /usr/include/linenum.h
  162.             /usr/include/syms.h
  163.             /usr/include/storclass.h
  164.  
  165.     STANDARD FILE:
  166.             /usr/include/a.out.h    "object file" 
  167.    */
  168.  
  169. #include <ds3100.md/filehdr.h>
  170. #include <ds3100.md/aouthdr.h>
  171. #include <ds3100.md/scnhdr.h>
  172. #include <ds3100.md/reloc.h>
  173.  
  174. /* Note if mips is defined syms.h includes sym.h and symconst.h */
  175. #include <ds3100.md/syms.h>
  176.  
  177. /*
  178.  * Coff files produced by the mips loader are guaranteed to have the raw data
  179.  * for the sections follow the headers in this order: .text, .rdata, .data and
  180.  * .sdata the sum of the sizes of last three is the value in dsize in the
  181.  * optional header.  This is all done for the benefit of the programs that
  182.  * have to load these objects so only the file header and optional header
  183.  * have to be inspected.  The macro N_TXTOFF() takes pointers to file header
  184.  * and optional header and returns the file offset to the start of the raw
  185.  * data for the .text section.  The raw data for the three data sections
  186.  * follows the start of the .text section by the value of tsize in the optional
  187.  * header.
  188.  *
  189.  * Object files produced by pre 0.23 versions of the compiler had their sections
  190.  * rounded to 8 byte boundaries.  0.23 and later versions have their sections
  191.  * rounded to 16 (SCNROUND in scnhdr.h) byte boundaries.
  192.  */
  193. #if 0
  194.  /* this is already defined in <sys/exec.h> */
  195.  
  196. #define N_TXTOFF(f, a) \
  197.  ((a).magic == ZMAGIC || (a).magic == LIBMAGIC ? 0 : \
  198.   ((a).vstamp < 23 ? \
  199.    ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + 7) & 0xfffffff8) : \
  200.    ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + SCNROUND-1) & ~(SCNROUND-1)) ) )
  201. #endif
  202.  
  203. #endif /* _AOUT */
  204. @
  205.  
  206.  
  207. 1.3
  208. log
  209. @Added include of <sys/exec.h>
  210. @
  211. text
  212. @d42 3
  213. a44 2
  214. #include <nlist.h>
  215. #include <sys/exec.h>
  216. d52 1
  217. a52 1
  218.      File Organization:
  219. d54 54
  220. a107 54
  221.      _______________________________________________    INCLUDE FILE
  222.      |_______________HEADER_DATA___________________|
  223.      |                          |
  224.      |    File Header                  |    "filehdr.h"
  225.      |.............................................|
  226.      |                          |
  227.      |    Auxilliary Header Information          |       "aouthdr.h"
  228.      |                          |
  229.      |_____________________________________________|
  230.      |                          |
  231.      |    ".text" section header              |       "scnhdr.h"
  232.      |                          |
  233.      |.............................................|
  234.      |                          |
  235.      |    ".data" section header              |          ''
  236.      |                          |
  237.      |.............................................|
  238.      |                          |
  239.      |    ".bss" section header              |          ''
  240.      |                          |
  241.      |_____________________________________________|
  242.      |______________RAW_DATA_______________________|
  243.      |                          |
  244.      |    ".text" section data (rounded to 4    |
  245.      |                bytes)          |
  246.      |.............................................|
  247.      |                          |
  248.      |    ".data" section data (rounded to 4    |
  249.      |                bytes)          |
  250.      |_____________________________________________|
  251.      |____________RELOCATION_DATA__________________|
  252.      |                          |
  253.      |    ".text" section relocation data          |    "reloc.h"
  254.      |                          |
  255.      |.............................................|
  256.      |                          |
  257.      |    ".data" section relocation data          |       ''
  258.      |                          |
  259.      |_____________________________________________|
  260.      |__________LINE_NUMBER_DATA_(SDB)_____________|
  261.      |                          |
  262.      |    ".text" section line numbers          |    "linenum.h"
  263.      |                          |
  264.      |.............................................|
  265.      |                          |
  266.      |    ".data" section line numbers          |          ''
  267.      |                          |
  268.      |_____________________________________________|
  269.      |________________SYMBOL_TABLE_________________|
  270.      |                          |
  271.      |    ".text", ".data" and ".bss" section   |    "syms.h"
  272.      |    symbols                      |       "storclass.h"
  273.      |                          |
  274.      |_____________________________________________|
  275. d115 1
  276. a115 1
  277.          OBJECT FILE COMPONENTS
  278. d117 2
  279. a118 2
  280.      HEADER FILES:
  281.              /usr/include/filehdr.h
  282. d130 5
  283. a134 4
  284. #include "filehdr.h"
  285. #include "aouthdr.h"
  286. #include "scnhdr.h"
  287. #include "reloc.h"
  288. d136 1
  289. a136 1
  290. #include "syms.h"
  291. d154 3
  292. d162 1
  293. a162 1
  294.  
  295. @
  296.  
  297.  
  298. 1.2
  299. log
  300. @ultrix version
  301. @
  302. text
  303. @d42 2
  304. a43 1
  305. #include <nlist.h>    /* included for all machines */
  306. @
  307.  
  308.  
  309. 1.1
  310. log
  311. @Initial revision
  312. @
  313. text
  314. @d1 28
  315. a29 3
  316.  * Copyright (c) 1980 Regents of the University of California.
  317.  * All rights reserved.  The Berkeley software License Agreement
  318.  * specifies the terms and conditions for redistribution.
  319. d31 5
  320. a35 1
  321.  *    @@(#)a.out.h    5.2 (Berkeley) 4/7/87
  322. d37 1
  323. a38 5
  324. /*
  325.  * Definitions of the a.out header
  326.  * and magic numbers are shared with
  327.  * the kernel.
  328.  */
  329. d42 1
  330. a42 4
  331. #include <sys/exec.h>
  332.  
  333. extern int Aout_PageSize[];
  334.  
  335. d44 1
  336. a44 2
  337.  * Macro to tell whether or not the magic number in an a.out file
  338.  * is an illegal one.
  339. d47 103
  340. a149 71
  341. #define    N_BADMAG(x) \
  342.     (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
  343.  
  344. /*
  345.  * Macros to tell where various pieces of information start in the
  346.  * a.out file.
  347.  */
  348.  
  349. #define N_PAGSIZ(x) (Aout_PageSize[(x).a_machtype])
  350.  
  351. #define N_SYMOFF(x) \
  352.     (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize + (x).a_drsize)
  353. #define    N_STROFF(x) \
  354.     (N_SYMOFF(x) + (x).a_syms)
  355.  
  356. /*
  357.  * Macros to tell where the various segments start in virtual memory,
  358.  * when the process is loaded.
  359.  */
  360. #include <kernel/procMach.h>
  361.  
  362. #define N_TXTADDR(x) PROC_CODE_LOAD_ADDR(x)
  363. #define N_DATADDR(x) PROC_DATA_LOAD_ADDR(x)
  364. #define N_BSSADDR(x) PROC_DATA_BSS_ADDR(x)
  365.  
  366. /*
  367.  * Format of a relocation datum.
  368.  */
  369. struct relocation_info {
  370.     int    r_address;    /* address which is relocated */
  371. unsigned int    r_symbolnum:24,    /* local symbol ordinal */
  372.         r_pcrel:1,     /* was relocated pc relative already */
  373.         r_length:2,    /* 0=byte, 1=word, 2=long */
  374.         r_extern:1,    /* does not include value of sym referenced */
  375.         :4;        /* nothing, yet */
  376. };
  377.  
  378. /*
  379.  * Format of a symbol table entry; this file is included by <a.out.h>
  380.  * and should be used if you aren't interested the a.out header
  381.  * or relocation information.
  382.  */
  383. struct    nlist {
  384.     union {
  385.         char    *n_name;    /* for use when in-core */
  386.         long    n_strx;        /* index into file string table */
  387.     } n_un;
  388. unsigned char    n_type;        /* type flag, i.e. N_TEXT etc; see below */
  389.     char    n_other;    /* unused */
  390.     short    n_desc;        /* see <stab.h> */
  391. unsigned long    n_value;    /* value of this symbol (or sdb offset) */
  392. };
  393. #define    n_hash    n_desc        /* used internally by ld */
  394.  
  395. /*
  396.  * Simple values for n_type.
  397.  */
  398. #define    N_UNDF    0x0        /* undefined */
  399. #define    N_ABS    0x2        /* absolute */
  400. #define    N_TEXT    0x4        /* text */
  401. #define    N_DATA    0x6        /* data */
  402. #define    N_BSS    0x8        /* bss */
  403. #define    N_COMM    0x12        /* common (internal to ld) */
  404. #define    N_FN    0x1e        /* file name symbol */
  405.  
  406. #define    N_EXT    01        /* external bit, or'ed in */
  407. #define    N_TYPE    0x1e        /* mask for all the type bits */
  408.  
  409. /*
  410.  * Sdb entries have some of the N_STAB bits set.
  411.  * These are given in <stab.h>
  412. d151 5
  413. a155 1
  414. #define    N_STAB    0xe0        /* if any of these bits set, a SDB entry */
  415. a156 4
  416. /*
  417.  * Format for namelist values.
  418.  */
  419. #define    N_FORMAT    "%08x"
  420. @
  421.